import { defineStore } from "pinia";
import https from "../utils/https";
export const usesearchs = defineStore("searchs", {
    state: () => {
        return {
            searchList: [] as any,
        }
    },
    actions: {
        // 模糊 get 搜索 https://creationapi.shbwyz.com/api/search/article?keyword=%E6%88%BF
        async getSearchs(keyword:any) {
            let res = await https.get("/api/search/article", { params: keyword})
                console.log(res.data.data,"search")
                if(res.status==200){
                    this.searchList = res.data.data
                }
        }
    },
    getters: {

    }
})